package com.eeepay.eeepay_v2.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.eeepay.eeepay_v2.R;
import com.eeepay.v2_library.log.LogUtils;

/**
 * Created by zw on 2016/3/9 0009.
 */
public class ColumnView extends LinearLayout{

    private View view;
    private TextView tv_money, tv_time;
    private ImageView iv_column;
//    private int bottomMargin;
//    private int topMargin;


    public ColumnView(Context context, AttributeSet attrs) {
        super(context, attrs);
        view = inflate(context, R.layout.column_view, this);
        init();
    }

    private void init() {
        tv_money = (TextView) view.findViewById(R.id.tv_money);
        tv_time = (TextView) view.findViewById(R.id.tv_time);
        iv_column = (ImageView) view.findViewById(R.id.iv_column);

//        LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) tv_money.getLayoutParams();
//        bottomMargin = layoutParams.bottomMargin;
//
//        LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) tv_time.getLayoutParams();
//        topMargin = layoutParams2.topMargin;

    }

    public void setTv_money(CharSequence text){
        this.tv_money.setText(text);
    }

    public void setTv_time(CharSequence text){
        this.tv_time.setText(text);
    }

    public void setColumnHeight(int height){
        if(height <= 0){
            this.iv_column.setVisibility(GONE);
        }else {
            ViewGroup.LayoutParams params = iv_column.getLayoutParams();
            params.height = height;
            this.iv_column.setLayoutParams(params);
        }


    }
}
